

func generateDistanceMap(_self, ):
	var gear_container = _self.gear_container;
	
	var gearList = gear_container.get_children();
	var len = gearList.size();
	
	var distanceMap = range(len).map(
		func (x): return range(len).map(
			func (x): return 0
		)
	);
	for i in range(gearList.size()):
		var ig = gearList[i];
		for j in range(gearList.size()):
			var ip = ig.position;
			var jp = gearList[j].position;
			distanceMap[i][j] = ip.distance_to(jp)
	return distanceMap;
